css grid two columns

32

.container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 1.75rem;
    width: min(90%, 68.5rem);
    margin-inline: auto;
}
.wrapper {
  display: grid;
  grid-gap: 1rem;
  grid-template-columns: 1fr 1fr 1fr;
  grid-auto-flow: dense;
  padding: 1rem;
}

.box {
  background-color: red;
  color: #fff;
  border-radius: 0.5rem;
  padding: 1rem;
  font-size: 200%;
}

.a,
.d,
.e,
.f {
  background-color: green;
  grid-column: span 2;     /* <-- here is the trick */
}

Comments

Submit
0 Comments